USE [BMIG_MENSUAL_POST_CADENA]

 -- creating the store procedure
IF EXISTS (SELECT name 
	   FROM   sysobjects 
	   WHERE  name = 'WASP_M0009_ACTUALIZA_FECHA'
	   AND 	  type = 'P') 
	DROP PROCEDURE [dbo].[WASP_M0009_ACTUALIZA_FECHA]
GO

CREATE PROCEDURE [dbo].[WASP_M0009_ACTUALIZA_FECHA](@FECHA CHAR(8)) AS
begin
  update dbo.ing_produccion_temp_ant
  set 
  	PeriodoPro = substring(cast(@FECHA as varchar),1,6),
  	FechaEnvio = @FECHA
END  	